/**
 * 功能描述
 */

define(function (require, exports, module) {
	
	var template = require("../assets/tpl/subnav.tpl");
	var HandlerBars = require("handlebars");
	
    var instance = {
    	click:function(e){
    		if(!$(e.target).parent().hasClass("active")){
        		$(".J-subnav #homeMenu li").removeClass("active");
        		$(e.target).parent().addClass("active");
        		return true;
    		}else{
    			return false;
    		}
    	},
        initComponent: function (params, widget) {
			var html = HandlerBars.compile(template)();
			$(".J-subnav").html(html);
        }
    };
    module.exports = instance;
});
